bazel: pass git to lint scripts in fix_lint#10813
Open
oharboe wants to merge 2 commits into
Open
Conversation
tcl_lint_test.sh and bzl_lint_test.sh take the git binary as their second argument (as their sh_test wrappers pass it), but //:fix_lint invoked them with only the lint tool, so 'bazelisk run //:fix_lint' always failed with '$2: unbound variable'. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds @git as a dependency and passes it as a ninth positional parameter ($9) to the linting commands in bazel/fix_lint.sh. The reviewer suggests assigning positional parameters to descriptive named variables at the beginning of the script to improve readability and maintainability instead of using magic positional parameters like $9.
Collaborator
Author
|
@hzeller FYI |
hzeller
reviewed
Jul 4, 2026
hzeller
reviewed
Jul 4, 2026
Review feedback: assign the positional parameters to named variables, matching the style of the per-language lint scripts, and use the passed git for the final status report. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bazelisk run //:fix_linthas been failing withbazel/tcl_lint_test.sh: line 10: $2: unbound variable: the lint scripts take the git binary as their second argument (theirsh_testwrappers pass$(rootpath @git)), but the//:fix_lintdriver invoked them with only the lint tool. Pass$(rootpath @git)through.Verification
bazelisk run //:fix_lintcompletes with both lint passes running (verified on top of #10812, since the prebuiltld.lldused by current master cannot start on an Ubuntu 26.04 host withoutlibxml2.so.2— the failure #10812 addresses).Type of Change
Bug fix (build infrastructure)
I have run the relevant tests and they pass
My code follows the repository's formatting guidelines
I have signed my commits (DCO).